<template>
	<!--新增对话框-->
	<el-dialog title="图像信息" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
		<div class="imageList">
			<div v-for="item in imageList" class="imageItem">
				<el-image style="width: 100px; height: 100px" :src="item" :preview-src-list="[item]"> </el-image>
			</div>
		</div>
	</el-dialog>
</template>

<script>
export default {
	name: 'ImageList',
	data() {
		return {
			imageList: [],
			dialogVisible: false,
		};
	},
	methods: {
		handleClose() {
			this.dialogVisible = false;
		},
		getImageList(item) {
			this.$axios
				.post('/user/feedback/imageUrls', {
					images: item.images,
				})
				.then((res) => {
					console.log('userList', res);
					this.imageList = res.data.images;
					// 其余的代码
				})
				.catch((error) => {
					console.error('发生请求错误：', error);
				});
		},
		init(item) {
			this.imageList = [];
			this.getImageList(item);
			this.dialogVisible = true;
		},
	},
};
</script>

<style>
.imageList {
	display: flex;
	flex-wrap: wrap;
}
.imageItem {
	padding: 10px;
}
</style>
